import java.util.Scanner;

public class Main {

    //异或和之和

    //给定一个数组，分别求其每个子段的异或和，并求出它们的和

    public static final int N = (int)1e5 + 10;
    public static int n;
    public static int[] a = new int[N];
    public static int[] sum = new int[N];
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        n = scan.nextInt();
        for (int i = 1; i <= n; i++) {
            a[i] = scan.nextInt();
            sum[i] = sum[i - 1] ^ a[i];
        }
        System.out.println(getSum());

    }

    private static long getSum() {
        long ans = 0;
        for (int i = 1; i <= n ; i++) {
            for (int j = i; j <= n ; j++) {
                ans += sum[j] ^ sum[i - 1];
            }
        }

        return ans;
    }
}
